﻿<UserControl x:Class="ScrumFactory.ProjectsList.ProjectsListView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             x:Name="ProjectView"
             Loaded="ProjectView_Loaded"
             d:DesignHeight="300" d:DesignWidth="300">
    
    
    <StackPanel>
        <ListView ItemsSource="{Binding Projects}" SelectionMode="Single" SelectedItem="{Binding SelectedProject, Mode=TwoWay}" Height="200"
                  IsSynchronizedWithCurrentItem="True"
                  DisplayMemberPath="Name" >
            <ListView.Style>
                <Style>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding IsLoadingData}" Value="true">
                            <Setter Property="ListView.Template">
                                <Setter.Value>
                                    <ControlTemplate>
                                        <TextBlock Foreground="LightGray">Loading Data...</TextBlock>    
                                    </ControlTemplate>                                    
                                </Setter.Value>
                            </Setter>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </ListView.Style>
            
        </ListView>
        
    </StackPanel>
</UserControl>
